﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WindowsFormsApp1
{
    /*************************************************************************************
 *
 * 文 件 名:   MyStruct
 * 描    述: 
 * 
 * 版    本：  V1.0
 * 创 建 者：  Fly
 * 创建时间：  2025/9/4 14:46:50
 *
 * --微信--：  xff19880420
 * --Email-：  xff2006@163.com
 * ======================================
 * 历史更新记录
 * 版本：V          修改时间：         修改人：
 * 修改内容：
 * ======================================
*************************************************************************************/
    /// <summary>模块运行状态</summary>
    public enum ModState
    {
        /// <summary>未运行</summary>
        None = -1,
        /// <summary>执行OK</summary>
        OK,
        /// <summary>执行异常</summary>
        NG,
        /// <summary>开始运行</summary>
        Start,
        /// <summary>无图像</summary>
        NoImage
    }
    public class ModuleParam
    {
        ///<summary>窗口名</summary>
        public string WindowName { get; set; } = "";
        /// <summary>链接图像名1</summary>
        public string LinkImageName1 { get; set; } = "";
        /// <summary>链接图像名2</summary>
        public string LinkImageName2 { get; set; } = "";
        /// <summary>链接图像名3</summary>
        public string LinkImageName3 { get; set; } = "";
        /// <summary>链接图像名4</summary>
        public string LinkImageName4 { get; set; } = "";
        ///<summary>插件名称 +  模块编号</summary>
        public string ModuleName { get; set; } = "";
        ///<summary>模块注释</summary>     
        public string ModuleRemarks { get; set; } = "";
        ///<summary>模块编号</summary>     
        public int ModuleEncode { get; set; } = 0;
        ///<summary>插件名称 每一个插件都是唯一</summary>     
        public string PluginName { get; set; } = "";
        /// <summary>///流程名</summary>
        public string ProjectName { get; set; } = "";
        ///<summary>是否启用</summary>    
        public bool IsUse { get; set; } = true;
        ///<summary>模块运行时间ms</summary>    
        public double CostTime { get; set; } = 0;
        ///<summary>所属的项目id</summary>    
        public int ProjectID { get; set; } = -1;
        /// <summary>使能</summary>
        public bool Enable { get; set; } = true;
        /// <summary>
        /// 是否启用链接数据
        /// </summary>
        public bool IsUseLinkData { get; set; } = true;
        /// <summary>
        /// 模块退出
        /// </summary>
        public bool Exit { get; set; } = true;
        /// <summary>测试结果</summary>
        public bool Result { get; set; } = true;
        /// <summary>图像宽度 </summary>
        public int ImageWidth { get; set; }
        /// <summary>图像高度 </summary>
        public int ImageHeight { get; set; }
        /// <summary>模块图标 </summary>
        public Icon Icon;
        /// <summary> 模块运行状态</summary>
        public ModState State { get; set; } = ModState.Start;    //模块运行状态
        /// <summary>
        /// 针对循环工具 循环多少次的,实际中,当循环次数到达CyclicCount的时候
        /// </summary>
        public int CyclicCount = 0;//
        /// <summary>
        /// 当前模块所在的循环的index地址
        /// </summary>
        [NonSerialized]
        public int pIndex = -1;

        /// <summary>
        /// 执行模块
        /// </summary>
        public bool ExeFlag = true;
        /// <summary>
        /// 是否显示文本
        /// </summary>
        public bool IsDispTxt { get; set; } = true;
        /// <summary>
        /// 绘制显示
        /// </summary>
        public string Setdraw { set; get; } = "margin";
        /// <summary>
        ///  绘制颜色
        /// </summary>
        public string DispColor { get; set; } = "red";
        /// <summary>
        /// 模块是否加锁
        /// </summary>
        public bool Lock { get; set; } = false;
    }
}
